import request from '@/utils/request';

export async function listTree() {
  return request('/jmonkey/system/duty/listTree');
}

/**
 * save
 * @param {params} params
 * @returns boolean
 */
export async function save(data) {
  return request('/jmonkey/system/duty/save', {
    method: 'POST',
    data,
  });
}

/**
 * update
 * @param {params} params 
 * @returns boolean
 */
export async function update(data) {
  return request('/jmonkey/system/duty/update', {
    method: 'PUT',
    data,
  });
}

/**
 * remove
 * @param {id} id id
 * @returns boolean
 */
export async function remove(id) {
  return request(`/jmonkey/system/duty/remove/${id}`, {
    method: 'DELETE',
  });
}
